package org.xinjiang.data.migration.flush.convert;

import org.mapstruct.Mapper;
import org.xinjiang.data.migration.common.constant.CreateConstant;
import org.xinjiang.data.migration.common.mapstruct.CommonConvertConfig;
import org.xinjiang.data.migration.hainan.entity.HnLocAreaEntity;
import org.xinjiang.data.migration.xinjiang.entity.SysAreaFenceEntity;


@Mapper(config = CommonConvertConfig.class)
public abstract class LocAreaFlushConvert {
    public SysAreaFenceEntity convert(HnLocAreaEntity loc) {
        SysAreaFenceEntity area = new SysAreaFenceEntity();
        area.setId(loc.getId());
        area.setName(loc.getName());
        area.setCode(String.valueOf(loc.getId()));
        area.setPcode(String.valueOf(loc.getPid()));
        area.setCoordinate(loc.getAreaDetail());
        area.setCreateBy(CreateConstant.SYSTEM);
        area.setUpdateBy(CreateConstant.SYSTEM);
        return area;
    }

}
